package cn.migu.music.hangupsms.cachemanage.handler.subhandler;


import cn.migu.music.hangupsms.cachemanage.event.ReLoadDbCacheEvent;
import cn.migu.music.hangupsms.cachemanage.handler.BusinessDbDataCacheServices;
import cn.migu.music.hangupsms.cachemanage.handler.ReloadDbCacheHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * <一句话描述>
 *
 * @author tanxiao
 * @date 2020/10/14 21:41
 */
@Component
public class ReloadAllDbHandle extends ReloadDbCacheHandler {
    /**
     * 缓存处理类的名称标记
     */
    public static final String          CACHE_HANDLER_NAME = "ReloadAllDb";

    @Autowired
    private BusinessDbDataCacheServices businessDbDataCacheServices;

    @PostConstruct
    @Override
    public void init() {
        dbCacheHandlerMap.putIfAbsent(CACHE_HANDLER_NAME, this);
    }

    @Override
    public void reload(ReLoadDbCacheEvent event) {
        businessDbDataCacheServices.init();
    }

    @Override
    public boolean equals(Object obj) {
        return super.equals(obj);
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }
}
